﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PMSA.Framework.Log;

public partial class Admin_Uc_Product_BrandManager : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            Brand obj = new Brand();
            int active = txtBrandActive.Checked ? 1 : 0;

            string _photoNull = "../Img/Layout/brandlogo.jpg";
            string _photoLink = "../Admin/Upload/Image/Brand/";
            string urlLogo = _photoNull;
            if (!String.IsNullOrEmpty(logoURL.Value))
            {
                urlLogo = _photoLink + logoURL.Value;
            }
            obj.Insert(txtBrandName.Text, urlLogo, active);
        }
        catch (Exception ex)
        {
            CLogManager.Write("BrandManager.btnAdd_Click", ex.ToString(), "ADMIN");
        }
    }
}